package entity

import "gin/common/db/config"


//多表 orm
//https://blog.csdn.net/kuangshp128/article/details/121139091

//用户表  sys_user
type SysUserEntity struct {
	UserId     int    `gorm:"column:user_id"`
	UserName   string `gorm:"column:user_name"`
	NickName   string `gorm:"column:nick_name"`
	DeptId   string `gorm:"column:dept_id"`
	sex   string `gorm:"column:sex"`

	//用户权限信息
	Perms string
}


//单位表 sys_dept
type SysDeptEntity struct {
	DeptId     int    `gorm:"column:dept_id"`
	ParentId   string `gorm:"column:parent_id"`
	DeptName   string `gorm:"column:dept_name"`
	CreateBy   string `gorm:"column:create_by"`
	UpdateTime   string `gorm:"column:update_time"`
}



func (SysUserEntity) TableName() string {
	return "sys_user"
}
func (SysDeptEntity) TableName() string {
	return "sys_dept"
}


func init() {
	config.GormDb.AutoMigrate(&SysUserEntity{}, &SysDeptEntity{})
}
